<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../../views/common/taglibs.jsp"%>
  <div id="u30" class="ax_default shape">
                <div id="u30_div" class=""></div>
                <!-- Unnamed () -->
                <div id="u31" class="text" style="visibility: visible;">
                  <p><span>
                  	邀请码管理
        			</span></p>
                </div>
  </div>
  <div id="u30" class="ax_default shape">
 
  	<a href="javascript:doActionNoCallback('core', '${appServer}/back/member/getMemberList.htm?pageNum=${memberListPageNum}', memberListParamNoPage);">&lt;返回</a>
  		
  </div>

  <div class="search">
	    <form id="inviteCodeListFrm" name="inviteCodeListFrm" action="${appServer}/back/member/generateInviteCode.htm" method="post" onsubmit="return false;">
		    <table width="99%" border="0" cellspacing="0" cellpadding="0">
			    <c:if test="${msg!=null}">
        		<tr>
			    	<td class="tc">
	        			<h2>${msg}</h2>
	        		</td>
				</tr>
  				</c:if>
			    <tr>
			    	
					<td class="tc"><input class="btAdd" name="" value="添加邀请码" type="button" 
						onclick="doActionNoCallback('core', '${appServer}/back/member/generateInviteCode.htm?pageNum=${page.totalPages}', inviteCodeListParamNoPage);" />
					</td>
				</tr>
		    </table>
	    </form>
  </div>
  
  <div class="tabtxet" id="listGameWind">
    <table class="tablist" cellspacing="0" cellpadding="0">
      <tr class="tabTop">
        <td colspan="17">
        	<div class="title">
        	邀请码列表
        	(共<strong>${page.totalCounts}</strong>条)</div>
        </td>
      </tr>
      <tr>
        <th>邀请码</th>
        <th>归属供应商</th>
        <th>创建时间</th>
        <th>创建者</th>
		<th>状态</th>
        <th>最后操作日期</th>
        <th>最后操作者</th>
        <th>操作</th>
      </tr>
      <c:forEach items="${inviteCodeList}" var="inviteCodeTemp" varStatus="status">
	      <tr>
	        <td>${inviteCodeTemp.code}</td>
	        <td>${inviteCodeTemp.memberName}</td>
	        <td><fmt:formatDate value="${inviteCodeTemp.timeAdd}" type="both"/></td>
	        <td></td>
	        <td>
	        <c:if test="${inviteCodeTemp.status=='0'}">有效</c:if>
	        <c:if test="${inviteCodeTemp.status=='1'}">无效</c:if>
	        <c:if test="${inviteCodeTemp.status=='2'}">已冻结</c:if>
	        </td>
			<td><fmt:formatDate value="${inviteCodeTemp.timeEdit}" type="both"/></td>
	        <td></td>
	        <td>
		        <c:if test="${inviteCodeTemp.status=='0'}">
		        <a href="javascript:doActionNoCallback('core', '${appServer}/back/member/freezeInviteCode.htm?inviteCodeId=${inviteCodeTemp.inviteCodeId}&pageNum=${page.pageNum}', inviteCodeListParamNoPage);">
		        	冻结
		        </a>
		        </c:if>
		        <c:if test="${inviteCodeTemp.status=='2'}">
		        <a href="javascript:doActionNoCallback('core', '${appServer}/back/member/resumeInviteCode.htm?inviteCodeId=${inviteCodeTemp.inviteCodeId}&pageNum=${page.pageNum}', inviteCodeListParamNoPage);">
		        	启用
		        </a>
		        </c:if>
	        </td>
	      </tr>
      </c:forEach>
      <tr>
      	<td colspan="17">
	      	共${page.totalPages}页 
	      	第${page.pageNum}页 
	      	<c:if test="${!page.showFirst}">首页</c:if>
	      	<c:if test="${page.showFirst}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/member/getInviteCodesForSupplier.htm?pageNum=1', inviteCodeListParamNoPage);">首页</a></c:if>
	      	<c:if test="${!page.showPrevious}">上一页</c:if>
	      	<c:if test="${page.showPrevious}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/member/getInviteCodesForSupplier.htm?pageNum=${page.pageNum-1}', inviteCodeListParamNoPage);">上一页</a></c:if>
	      	<c:if test="${!page.showNext}">下一页</c:if>
	      	<c:if test="${page.showNext}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/member/getInviteCodesForSupplier.htm?pageNum=${page.pageNum+1}', inviteCodeListParamNoPage);">下一页</a></c:if>
	      	<c:if test="${!page.showLast}">尾页</c:if>
	      	<c:if test="${page.showLast}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/member/getInviteCodesForSupplier.htm?pageNum=${page.totalPages}', inviteCodeListParamNoPage);">尾页</a></c:if>
      	</td>
      </tr>
    </table>
  </div>

	<script type="text/javascript">
	    inviteCodeListParamNoPage = {'memberId' : '${inviteCode.memberId}', 'memberListPageNum' : '${memberListPageNum}', 'nickName' : '${member.nickName}', 'memberName' : '${member.memberName}', 'type' : '${member.type}'};
	    memberListParamNoPage = {'nickName' : '${member.nickName}', 'memberName' : '${member.memberName}', 'type' : '${member.type}'};
    </script>